<template>
  <div class="attr">
    <div class="content">
      <div title="加成攻击力">力量: {{ currentAttrs.STR }}</div>
      <div title="决定生命值和回复能力，加成防御力">
        体质: {{ currentAttrs.VIT }}
      </div>
      <div title="加成攻击速度和暴击率">敏捷: {{ currentAttrs.DEX }}</div>
      <div></div>
      <div>生命值: {{ currentAttrs.HP }}</div>
      <div>生命缓和: {{ currentAttrs.RHP }}</div>
      <div>攻击力: {{ currentAttrs.ATK }}</div>
      <div>防御力: {{ currentAttrs.DEF }}</div>
      <div>攻击速度: {{ currentAttrs.AS }}</div>
      <div>暴击率: {{ (currentAttrs.CRR * 100).toFixed(2) }}%</div>
      <div>暴击伤害: {{ (currentAttrs.CRD * 100).toFixed(2) }}%</div>
    </div>
    <div class="footer"></div>
  </div>
</template>
<script lang="ts">
import { computed, ComputedRef } from "vue";
import { useStore } from "@/store";
import { PlayerBattleProperty } from "@/store/player/types";
const store = useStore();
export default {
  name: "Attrs",
  setup() {
    const currentAttrs: ComputedRef<PlayerBattleProperty> = computed(() => {
      return store.getters.playerBattleProperty;
    });

    return {
      currentAttrs
    };
  }
};
</script>
<style lang="scss" scoped>
.attr {
  width: 300px;
  color: #eee;
  .content {
    padding: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
  }
}
</style>
